<template>
	<!-- 底部菜单 -->
	<view class="commenMenu">
		<view :class="{ check: checkIndex == 1 }" @click="goToPage('createOrder')">
      <u-icon name="home-fill" size="42" style="margin-bottom: 6rpx;"></u-icon>
			<text>点餐</text>
		</view>
		<view :class="{ check: checkIndex == 2 }" @click="goToPage('order')">
      <u-icon name="account-fill" size="42" style="margin-bottom: 6rpx;"></u-icon>
			<text>订单</text>
		</view>
	</view>
</template>

<script>
export default {
	props: ['checkIndex'],
	data() {
		return {};
	},
	methods: {
		goToPage(type) {
			let url;
			switch (type) {
				case 'createOrder':
					url = '/pages/order';
					break;
				case 'order':
					url = '/pages/company/allOrder';
					break;
			}
			uni.navigateTo({
				url
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.commenMenu {
	z-index: 2;
	position: fixed;
	// left: 0;
	bottom: 0;
	width: 100%;
	height: 100rpx;
	background-color: #fff;
	border-top: 1px solid #eee;
	@include flexs(space-around, center);

	> view {
		@include flexs(center, center);
		flex-direction: column;

		font-size: 26rpx;
		line-height: 1;
		padding: 5rpx 0 15rpx 0;
		color: #ccc;
	}

	> .check {
		color: #fa690a;
		font-weight: bold;
	}
}
</style>
